<?php

class Core_Api_Tab
{
	function getElement($path, $tab)
	{
		$table = Nuo::getTable('core/tab');

		$select = $table -> select() -> from($table -> getName(), 'element') -> where('path=?', $path) -> where('tab=?', $tab);

		$element = $table -> getAdapter() -> fetchOne($select);

		if (!$element)
		{
			$select = $table -> select() -> from($table -> getName(), 'element') -> where('path=?', $path) -> where('tab=?', 'general');

			$element = $table -> getAdapter() -> fetchOne($select);
		}

		return $element;
	}
}
